package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmBuyCourse;
import com.drm.netschool.entity.DrmBuyCourseExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmBuyCourseMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int countByExample(DrmBuyCourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int deleteByExample(DrmBuyCourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    @Delete({
        "delete from drm_buy_course",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    @Insert({
        "insert into drm_buy_course (id, course_id, ",
        "user_id, buy_dt, ",
        "order_price, org_price, ",
        "current_price, order_id, ",
        "comfirm_yn)",
        "values (#{id,jdbcType=BIGINT}, #{courseId,jdbcType=BIGINT}, ",
        "#{userId,jdbcType=BIGINT}, #{buyDt,jdbcType=TIMESTAMP}, ",
        "#{orderPrice,jdbcType=BIGINT}, #{orgPrice,jdbcType=BIGINT}, ",
        "#{currentPrice,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR}, ",
        "#{comfirmYn,jdbcType=INTEGER})"
    })
    int insert(DrmBuyCourse record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int insertSelective(DrmBuyCourse record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    List<DrmBuyCourse> selectByExample(DrmBuyCourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    @Select({
        "select",
        "id, course_id, user_id, buy_dt, order_price, org_price, current_price, order_id, ",
        "comfirm_yn",
        "from drm_buy_course",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmBuyCourse selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmBuyCourse record, @Param("example") DrmBuyCourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int updateByExample(@Param("record") DrmBuyCourse record, @Param("example") DrmBuyCourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    int updateByPrimaryKeySelective(DrmBuyCourse record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_course
     *
     * @mbggenerated Mon Aug 24 06:30:40 CST 2015
     */
    @Update({
        "update drm_buy_course",
        "set course_id = #{courseId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "buy_dt = #{buyDt,jdbcType=TIMESTAMP},",
          "order_price = #{orderPrice,jdbcType=BIGINT},",
          "org_price = #{orgPrice,jdbcType=BIGINT},",
          "current_price = #{currentPrice,jdbcType=BIGINT},",
          "order_id = #{orderId,jdbcType=VARCHAR},",
          "comfirm_yn = #{comfirmYn,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmBuyCourse record);
}